package com.chinasoft;

import com.chinasoft.bean.Account;
import com.chinasoft.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        //                                                              accountService
        AccountService accountService = (AccountService)ctx.getBean("accountService");
        System.out.println(accountService);

        List<Account> all = accountService.findAll();
        all.forEach(System.out :: println);

    }
}